<?php $global = \Session::get('GLOBAL_OPTIONS');?>
<!-- nav -->
<style type="text/css">
/*重写Logo*/
.logo{
  position: absolute;
  top: 0;
  left: 0;
  width: 226px;
  height: 73px;
  display: inline;
  overflow: hidden;
  <?php echo isset($global) && $global ? "background: url({$global['web_logo']}) no-repeat;":"";?>
}
</style>
      <div class="topArea" style="z-index:3;">
        <div class="bd">
          <div class="logo">
            <a href="/web/index/index"></a>
          </div>
          <div class="nav">
              <!-- 一级菜单 -->
             <?php if(isset($nav_menu) && $nav_menu){?>
                <ul class="navs">
                  <?php $count = 0;?>
                  <?php foreach ($nav_menu as $key => $value) { ?>
                    <?php $count ++;?>
                    <li class=""><a href="<?php echo $value['url'];?>" class="<?php echo $value['id'] == \Input::get('l',0) ? 'current' : ''; ?>"><?php echo $value['name'];?></a></li>
                  <?php }?>
                </ul>
              <?php }?>
              <!-- 一级子菜单 -->
              <!-- 二级子菜单 -->
              <div class="subNav" style="left: 0px; display: none;">
                <?php if(isset($nav_menu) && $nav_menu){?>
                    <?php $count = 0;?>
                    <?php foreach ($nav_menu as $key => $value) { ?>
                      
                      <?php if(isset($value['children']) && $value['children']){?>
                      
                      <div class="sub clearfix sub<?php echo $count;?>" style="display: none;">
                      <?php $count ++;?>
                        <ul>
                        <?php foreach ($value['children'] as $k => $v) { ?>
                          <li><a href="<?php echo $v['url'];?>"><?php echo $v['name'];?></a></li>
                        <?php }?>
                        </ul>
                      </div >
                      <?php }?>
                        
                    <?php }?>

                <?php }?>
              </div>
              <!-- end 二级子菜单 -->
          </div>
        </div>
      </div>
    <script type="text/javascript">
        $(function(){
          $(".subNav .sub").each(function(x){
            $(this).addClass('sub'+ x);
          });
          $(".navs li").each(function(i){
            var position = $(this).position();
            var positionLeft = position.left;
            $(this).mousemove(function(){
              $(".subNav").show();
              $(".subNav").css({left:positionLeft});
              $(".subNav").children().hide();
              var t = i - 1;
              $(".sub"+t).show();
              var tt = $(".sub"+t).find('ul').height();
              //$(".sub"+t).find('ul').css({'margin-top':-(tt-7)/2-20})
              $(".navs li").removeClass("on");
              $(this).addClass("on");
            });
          });
          $(".nav").mouseleave(function(){
            $(".navs li").removeClass("on");
            $(".subNav").hide();
            $(".subNav").children().hide();
          });
        });
        </script>
<!--  end nav -->